package com.school.sports.controller;

import com.school.sports.entity.RefereeAssignment;
import com.school.sports.service.RefereeAssignmentService;
import com.school.sports.common.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RequestMapping("/refereeAssignments")
@Slf4j
@RestController
public class RefereeAssignmentController {

    @Autowired
    private RefereeAssignmentService refereeAssignmentService;

    @GetMapping("/{id}")
    public Result<RefereeAssignment> getRefereeAssignment(@PathVariable("id") Long id) {
        RefereeAssignment result = refereeAssignmentService.getRefereeAssignmentById(id);
        return Result.success(result);
    }
}
